          <?php $errorLinkage = Yii::app()->user->hasFlash('errorLinkage') ? unserialize(Yii::app()->user->getFlash('errorLinkage')) : null ?>
          <!-- START OF MAINCOL -->
          <div class="MainCol AddEbookPage">
          	  <h1>编辑题目跳转</h1>
              <span class="NormalFont SmallFont">
                  <?= CHtml::image(Yii::app()->baseUrl.'/images/home_icon.gif', '主页'); ?> > 心理测试管理 > 编辑心理测试主题 > 编辑心理测试题目 > 编辑题目跳转
               </span><br /><br />
              <div class="Titlebox box"><!-- DON'T DELETE --></div>

              <?php if(Yii::app()->user->hasFlash('successMessage')) : ?>
              <div class="SuccessfulBox Smallbox">
                <span class="Successful"> <?php echo Yii::app()->user->getFlash('successMessage'); ?></span>
              </div>
              <?php endif; ?>

	            <?php if($errorLinkage !== null) : ?>
	            <?php echo CHtml::errorSummary($errorLinkage) ?>
	            <?php endif ?>

              <?php echo CHtml::form(array('/admin/psytest/updateanswerlinkage')) ?>
              <?php echo CHtml::activeHiddenField($linkage, 'linkageId') ?>
              <div class="Smallbox"><label><?php echo $linkage->answer->answerOrder ?></label>
              <?php echo $linkage->answer->answer ?></div>


              <div class="Smallbox"><label>跳转目标类型</label>
              <?php echo CHtml::activeDropDownList($linkage, 'linkType', TestAnswerLinkage::linkType2Text(), array('class' => 'edit-jumping-to-type')) ?></div>

              <div class="Smallbox"><label>跳转目标</label>
              <?php echo CHtml::activeDropDownList($linkage, 'linkToId', $questionsListData, array('class' => 'edit-link-to-id-question')) ?><?php echo CHtml::activeDropDownList($linkage, 'linkToId', CHtml::listData($conclusions, 'conclusionId', 'conclusionSum'), array('class' => 'edit-link-to-id-conclusions')) ?></div>

              <div class="Smallbox btnBox"><label>&nbsp;</label>
              <?= CHtml::submitButton('提交'); ?>
              </div>

              <?php echo CHtml::endForm() ?>
              <div class="Smallbox btnBox"><label>&nbsp;</label>
              <?= CHtml::link('返回', array('admin/psytest/editquestions2', 'id' => $linkage->answer->question->topic->topicId)); ?>
              </div>
          </div>
          <!-- END OF MAINCOL -->
        <script type="text/javascript">
             $('select.edit-jumping-to-type').change(function() {
                 if($(this).val() == '<?php echo TestAnswerLinkage::LINKTYPE_QUESTION ?>') {
                    $('select.edit-link-to-id-conclusions').hide();
                    $('select.edit-link-to-id-conclusions').attr('disabled', true);
                    $('select.edit-link-to-id-question').show();
                    $('select.edit-link-to-id-question').attr('disabled', '');
                 } else if($(this).val() == '<?php echo TestAnswerLinkage::LINKTYPE_CONCLUSION ?>') {
                    $('select.edit-link-to-id-question').hide();
                    $('select.edit-link-to-id-question').attr('disabled', true);
                    $('select.edit-link-to-id-conclusions').show();
                    $('select.edit-link-to-id-conclusions').attr('disabled', '');
                 }
             });
             $('select.edit-jumping-to-type').trigger('change');
         </script>
